package leecode

func sumOfLeftLeaves(root *TreeNode) (result int) {
	if root == nil {
		return
	}
	//左节点的叶子节点的值
	leftValue := sumOfLeftLeaves(root.Left)
	//根节点的左叶子节点的值
	if root.Left != nil && root.Left.Left == nil && root.Left.Right == nil {
		leftValue = root.Left.Val
	}
	rightLeftValue := sumOfLeftLeaves(root.Right)
	return leftValue + rightLeftValue
}
